package service

import (
	"duoke/tables"
	"duoke/utils/orm"
)

var CopyCs = new(copyCsService)

type copyCsService struct{}

func (s *copyCsService) InfoByCopyId(copyId int, field string) (*tables.CopyCs, error) {
	user := new(tables.CopyCs)
	_, err := orm.Db.Where("copy_id =?", copyId).Cols(field).Get(user)
	if err != nil {
		return nil, err
	}
	return user, nil
}
